public class Main {
    public static void main(String[] args) {
        MaxHeap maxHeap = new MaxHeap(1);
        int[] a = new int[]{5, 2, 6, 7, 3, 2, 5, 1, 8};
        for (int each : a) {
            maxHeap.offer(each);
        }
        while (!maxHeap.isEmpty()) {
            System.out.println(maxHeap.poll());
        }
    }
}
